Remove GtkFontChooser:[sg]et_font
authorChristian Persch <chpe@gnome.org>
Mon, 5 Sep 2011 20:55:05 +0000 (22:55 +0200)
committerChristian Persch <chpe@gnome.org>
Tue, 13 Sep 2011 10:55:22 +0000 (12:55 +0200)
Now that the setter doesn't return a value anymore, we can just use
g_object_[sg]et instead of having these vfuncs.

gtk/gtkfontbutton.c
gtk/gtkfontchooser.c
gtk/gtkfontchooser.h
gtk/gtkfontchooserutils.c
gtk/gtkfontchooserwidget.c

index dc0fde66b7fd37650fcbaa4d3bcd1359de6cb675..e05223ca79490ac3f4f6239c97bea4261f5f8a11 100644 (file)
@@ -193,23 +193,6 @@ gtk_font_button_set_show_preview_entry (GtkFontButton *font_button,
   priv->show_preview_entry = show != FALSE;
 }
 
-static gchar *
-gtk_font_button_font_chooser_get_font (GtkFontChooser *chooser)
-{
-  GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
-
-  return g_strdup (gtk_font_button_get_font_name (font_button));
-}
-
-static void
-gtk_font_button_font_chooser_set_font (GtkFontChooser *chooser,
-                                       const gchar    *fontname)
-{
-  GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
-
-  gtk_font_button_set_font_name (font_button, fontname);
-}
-
 static PangoFontFamily *
 gtk_font_button_font_chooser_get_font_family (GtkFontChooser *chooser)
 {
@@ -275,8 +258,6 @@ gtk_font_button_font_chooser_notify (GObject    *object,
 static void
 gtk_font_button_font_chooser_iface_init (GtkFontChooserIface *iface)
 {
-  iface->get_font = gtk_font_button_font_chooser_get_font;
-  iface->set_font = gtk_font_button_font_chooser_set_font;
   iface->get_font_family = gtk_font_button_font_chooser_get_font_family;
   iface->get_font_face = gtk_font_button_font_chooser_get_font_face;
   iface->get_font_size = gtk_font_button_font_chooser_get_font_size;
index c83174f4caee4af37a81688862c38b9120edca61..dc7d2ec6eedb921f098e950b50c7c825a2d9bcea 100644 (file)
@@ -186,9 +186,14 @@ gtk_font_chooser_get_size (GtkFontChooser *fontchooser)
 gchar *
 gtk_font_chooser_get_font (GtkFontChooser *fontchooser)
 {
+  gchar *fontname;
+
   g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
 
-  return GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->get_font (fontchooser);
+  g_object_get (fontchooser, "font", &fontname, NULL);
+
+
+  return fontname;
 }
 
 /**
@@ -207,8 +212,7 @@ gtk_font_chooser_set_font (GtkFontChooser *fontchooser,
   g_return_if_fail (GTK_IS_FONT_CHOOSER (fontchooser));
   g_return_if_fail (fontname != NULL);
 
-  GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->set_font (fontchooser,
-                                                      fontname);
+  g_object_set (fontchooser, "font", fontname, NULL);
 }
 
 /**
index 8573f8ccf220f6401fd643e75a0d3bb8b013eccc..b436bedb39084a0e773894e375bc4467602027bb 100644 (file)
@@ -59,12 +59,10 @@ struct _GtkFontChooserIface
   GTypeInterface base_iface;
 
   /* Methods */
-  gchar *           (* get_font)                (GtkFontChooser *chooser);
-  void              (* set_font)                (GtkFontChooser *chooser,
-                                                 const gchar    *fontname);
   PangoFontFamily * (* get_font_family)         (GtkFontChooser  *chooser);
   PangoFontFace *   (* get_font_face)           (GtkFontChooser  *chooser);
   gint              (* get_font_size)           (GtkFontChooser  *chooser);
+
   void              (* set_filter_func)         (GtkFontChooser   *chooser,
                                                  GtkFontFilterFunc filter,
                                                  gpointer          data,
index 418442f2b6c4f71e14617f329f9085f23d0b954e..15bc77066d3c843069623255597701fe3b7a7fdf 100644 (file)
@@ -35,19 +35,6 @@ get_delegate (GtkFontChooser *receiver)
                              GTK_FONT_CHOOSER_DELEGATE_QUARK);
 }
 
-static gchar *
-delegate_get_font (GtkFontChooser *chooser)
-{
-  return gtk_font_chooser_get_font (get_delegate (chooser));
-}
-
-static void
-delegate_set_font (GtkFontChooser *chooser,
-                        const gchar    *fontname)
-{
-  gtk_font_chooser_set_font (get_delegate (chooser), fontname);
-}
-
 static PangoFontFamily *
 delegate_get_font_family (GtkFontChooser *chooser)
 {
@@ -149,8 +136,6 @@ _gtk_font_chooser_install_properties (GObjectClass *klass)
 void
 _gtk_font_chooser_delegate_iface_init (GtkFontChooserIface *iface)
 {
-  iface->get_font = delegate_get_font;
-  iface->set_font = delegate_set_font;
   iface->get_font_family = delegate_get_font_family;
   iface->get_font_face = delegate_get_font_face;
   iface->get_font_size = delegate_get_font_size;
index 568df2fc0f3f999642035acb038e7e01194dfea2..956f59629d5f88bbdc56ec41791b1c60a293152a 100644 (file)
@@ -1187,8 +1187,6 @@ gtk_font_chooser_widget_set_filter_func (GtkFontChooser  *chooser,
 static void
 gtk_font_chooser_widget_iface_init (GtkFontChooserIface *iface)
 {
-  iface->get_font = gtk_font_chooser_widget_get_font;
-  iface->set_font = gtk_font_chooser_widget_set_font;
   iface->get_font_family = gtk_font_chooser_widget_get_family;
   iface->get_font_face = gtk_font_chooser_widget_get_face;
   iface->get_font_size = gtk_font_chooser_widget_get_size;